import React from 'react'
import { useLocation } from 'react-router-dom'

export default function State() {
    // let x = useLocation();
    // console.log('x: ', x);

    // 获取state参数
    let {state:{id, title}} = useLocation();
    return (
        <div>
            <h3>State参数</h3>
            <p>id:{id}</p>
            <p>title:{title}</p>
        </div>
    )
}
